using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

using Bll;
using Entities;

public partial class product : MyPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Check query string to avoid input address manually by user
            if (Request.QueryString.Count == 2)
            {                
                string categoryID = Request.QueryString[0];
                string categoryName = Request.QueryString[1];
                if (!string.IsNullOrEmpty(categoryName) && !string.IsNullOrEmpty(categoryID))
                {
                    ProductBll proBll = new ProductBll();
                    int productNumber = proBll.CountProduct(categoryID);
                    lblCatName.Text = "Category : " + categoryName;
                    lblProNum.Text = "++ Number of products : " + productNumber;
                }
                else
                {

                }                
            }
            else
            { 
                lblCatName.Text = "Category : Automotive Lights";
                lblProNum.Text = "++ Number of products : 23";
            }

        }
    }

}
